#include "widget.h"
#include "ui_widget.h"
#include<QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);/*
    void (Widget::*Signal_p)(QString)=&Widget::Mysignal;
    void (Widget::*Slot_p)(QString)=&Widget::Myslot;
    connect(this,Signal_p,this,Slot_p);*/
    connect(this,&Widget::Mysignal,this,&Widget::Myslot);
    EmitSignal();
}


void Widget::EmitSignal()
{
    emit this->Mysignal("hello");

//    emit this->Mysignal();
}



void Widget::Myslot()
{

    qDebug()<<"Widget::Myslot()被调用";
}

//void Widget::Myslot(QString str)
//{
//    qDebug()<<"Widget::Myslot(QString)被调用"<<str;
//}

Widget::~Widget()
{
    delete ui;
}

